package com.zhanggm.springcloud.jpa.entity;

import com.zhanggm.springcloud.jpa.enums.IsDelete;
import lombok.Data;

import java.io.Serializable;
import java.util.List;

import javax.persistence.*;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;
import com.fasterxml.jackson.annotation.JsonInclude;
import com.fasterxml.jackson.annotation.JsonFormat;

/**
 * @author zhanggm
 * null
 */
@Data
@JsonInclude(JsonInclude.Include.NON_NULL)
@Entity
@Table(name = "stu_area"/*,catalog = "1804d",schema = "1804d"*/)
@DynamicInsert
@DynamicUpdate
public class StuArea extends BaseEntity implements Serializable {

	/**
	 * null
	 */
	@Id
	@GeneratedValue(strategy = GenerationType.IDENTITY)
	@Column(name = "id",columnDefinition = "int(11) NOT NULL AUTO_INCREMENT COMMENT '主键'")
	private Integer id;

	/**
	 * null
	 */
	@Column(name = "code")
	private String code;

	/**
	 * null
	 */
	@Column(name = "name")
	private String name;

	/**
	 * null
	 */
	@Column(name = "pid")
	private Integer pid;

	/**
	 * null
	 */
	@Column(name = "lft")
	private Integer lft;

	/**
	 * null
	 */
	@Column(name = "rgt")
	private Integer rgt;

	/**
	 * null
	 */
	@Column(name = "name_en")
	private String nameEn;

	/**
	 * null
	 */
	@Column(name = "short_name_en")
	private String shortNameEn;

	/**
	 * null
	 */
	@Column(name = "is_show")
	private Boolean isShow;

	@Transient
	private List<StuArea> subList;

	@Enumerated(EnumType.ORDINAL)
	private IsDelete isDelete;
}
